package com.sunxboy.platform.util;

import org.springframework.beans.factory.FactoryBean;

/**
 * This class will return a string formated according to specified format string and provided beans
 */
@SuppressWarnings("rawtypes")
public class StringFormaterFactory implements FactoryBean {
    private final String value;

    public StringFormaterFactory(String format, Object... objects) {
        this.value = String.format(format, objects);
    }

    public Object getObject() throws Exception {
        return value;
    }

    public Class<String> getObjectType() {
        return String.class;
    }

    public boolean isSingleton() {
        return true;
    }

}
